<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/web/head.jsp"%>
<link rel="stylesheet" type="text/css"
	href="<%=app%>/web/base/css/login.css" />
<title>后台登录</title>
</head>
<body>
<body style="background-color: #f0f0f0;">
	<div id="window">
		<div id="title">
			<label>后台管理系统登录</label>
		</div>
		<div id="form">
			<form class="layui-form layui-form-pane">
				<div class="layui-form-item">
					<label class="layui-form-label"> <i
						class="layui-icon layui-icon-username"></i>
					</label>
					<div class="layui-input-block">
						<input type="text" name="account" required lay-verify="required"
							placeholder="请输入账号" style="width: 70%;" autocomplete="off"
							class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"> <i
						class="layui-icon layui-icon-password"></i>
					</label>
					<div class="layui-input-block">
						<input type="password" name="password" required
							lay-verify="required" placeholder="请输入密码" style="width: 70%;"
							autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"> <img
						src="${pageContext.request.contextPath}/AuthCodeServlet"
						onclick="this.src='${pageContext.request.contextPath}/AuthCodeServlet?'+Math.random()">
					</label>
					<div class="layui-input-block">
						<input type="text" name="authcode" required
							lay-verify="required" placeholder="请输入密码" style="width: 70%;"
							autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item btn">
					<div class="layui-input-block">
						<input type="button" class="layui-btn" lay-submit
							lay-filter="login" value="登录" style="width: 40%;">
					</div>
				</div>
				<input type="hidden" name="action" value="login">
			</form>
		</div>
	</div>

	<script type="text/javascript">
		formOnSubmit('login', 'text', '/ManagerServlet', function(data) {
			if (data == 'success') {
				layer.msg("登陆成功", {
					time : 1000
				}, function() {
					goUrl("/web/manager/managerMain.jsp")
				});
			}else if(data == 'authcode') {
				layer.msg("验证码错误");
			}
			else {
				layer.msg("账号密码错误");
			}
		})
	</script>
</body>
</html>